OUT_DIR=`pwd`

BPF_TOOL_DIR=~/openharmony/kernel/linux/linux-5.10/tools/bpf/bpftool

export ARCH=arm
export LLVM=/opt/toolchain-ohos/native/llvm
export AS=${LLVM}/bin/llvm-as
export CC="${LLVM}/bin/clang --target=${ARCH}-linux-ohos"
export CXX="${LLVM}/bin/clang++ --target=${ARCH}-linux-ohos"
export LD="${LLVM}/bin/ld.lld"
export STRIP=${LLVM}/bin/llvm-strip
export RANLIB=${LLVM}/bin/llvm-ranlib
export OBJDUMP=${LLVM}/bin/llvm-objdump
export OBJCOPY=${LLVM}/bin/llvm-objcopy
export NM=${LLVM}/bin/llvm-nm
export AR=${LLVM}/bin/llvm-ar
export CFLAGS="-fPIC -D__MUSL__=1"
export CXXFLAGS="-fPIC -D__MUSL__=1"


pushd $BPF_TOOL_DIR

rm -rf $OUT_DIR
mkdir $OUT_DIR

export OUTPUT=$OUT_DIR
export prefix=$OUT_DIR/install/
#make clean 

make V=1 ARCH=$ARCH

make install

popd
